package com.qianli.cashmama.trade.domain.services;

import com.qianli.cashmama.trade.domain.model.TradeBase;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/20
 * Time: 下午4:35
 * <p>
 * 交易服务
 */
public interface TradeBaseService {

    /**
     * 创建交易
     *
     * @param tradeBase
     * @return
     */
    TradeBase createTrade(TradeBase tradeBase);

    /**
     * 关闭信审拒绝的订单
     *
     * @param tradeBase
     */
    void closeAuditRejectTrade(TradeBase tradeBase);

    /**
     * 信审通过订单（到电子签）
     *
     * @param tradeBase
     */
    void auditPassToEsign(TradeBase tradeBase);

    /**
     * 信审通过（到待打款）
     *
     * @param tradeBase
     */
    void auditPass(TradeBase tradeBase);

    /**
     * 信审通过（到待用户提现）
     *
     * @param tradeBase
     */
    void auditPassToWithdraw(TradeBase tradeBase);

    /**
     * 提现确认（到待打款）
     *
     * @param tradeBase
     */
    void withdrawalConfirm(TradeBase tradeBase);

    /**
     * 到等待highmark
     *
     * @param tradeBase
     */
    void waitingForHighMark(TradeBase tradeBase);

    /**
     * highmark 通过
     *
     * @param tradeBase
     */
    void highMarkPass(TradeBase tradeBase);

    /**
     * highmark 拒绝
     *
     * @param tradeBase
     */
    void highMarkReject(TradeBase tradeBase);

    /**
     * 创建支付任务
     *
     * @param tradeBase
     * @param isRebindCard
     */
    void createPayTask(TradeBase tradeBase, boolean isRebindCard);


    /**
     * 放款成功
     *
     * @param tradeBase
     */
    void paymentSuccess(TradeBase tradeBase);

    /**
     * @param tradeBase
     * @param payRetry  是否重试支付
     */
    void loanFailed(TradeBase tradeBase, boolean payRetry);

    /**
     * 签名成功
     *
     * @param tradeBase
     */
    void signSuccess(TradeBase tradeBase);

    /**
     * 签名失败
     *
     * @param tradeBase
     */
    void signFailed(TradeBase tradeBase);

    /**
     * 签名超时关闭
     *
     * @param tradeBase
     */
    void signTimeOut(TradeBase tradeBase);

    /**
     * 展期成功
     *
     * @param tradeBase
     */
    void extensionSuccess(TradeBase tradeBase);

    void earlyPayment(TradeBase tradeBase);

    void normalPayment(TradeBase tradeBase);

    void overduePayment(TradeBase tradeBase);

    /**
     * 3到5
     *
     * @param tradeBase
     */
    void loanSuccess(TradeBase tradeBase);

    /**
     * 11到5
     *
     * @param tradeBase
     */
    void loanConfirmSuccess(TradeBase tradeBase);

    void overdue(TradeBase tradeBase);
}
